home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR10 / YICN23.ZIP / INCLUDE / XLIB.H < prev    next >
C/C++ Source or Header  |  1992-11-19  |  6KB  |  138 lines

  1. /*----------------------------------------------------------------------
  2. ;
  3. ; XLIB - header file
  4. ;
  5. ;
  6. ;
  7. ; ****** XLIB - Mode X graphics library                ****************
  8. ; ******                                               ****************
  9. ; ****** Written By Themie Gouthas                     ****************
  10. ;
  11. ; egg@dstos3.dsto.gov.au
  12. ; teg@bart.dsto.gov.au
  13. ;
  14. ; Header file contributed by Darren Lyon (darren@nicky.DIALix.oz.au)
  15. ;
  16. ;
  17. ;  Terminology & notes:
  18. ;         VRAM ==   Video RAM
  19. ;         SRAM ==   System RAM
  20. ;         X coordinates are in pixels unless explicitly stated
  21. ;
  22. ;----------------------------------------------------------------------*/
  23.  
  24. #ifndef _XLIB_H_
  25. #define _XLIB_H_
  26.  
  27. #define BYTE unsigned char
  28. #define WORD unsigned int
  29.  
  30. #define X_MODE_320x200  0
  31. #define X_MODE_320x240  1
  32. #define X_MODE_360x200  2
  33. #define X_MODE_360x240  3
  34. #define X_MODE_376x282  4
  35. #define X_MODE_320x400  5
  36. #define X_MODE_320x480  6
  37. #define X_MODE_360x400  7
  38. #define X_MODE_360x480  8
  39. #define X_MODE_360x360  9
  40. #define X_MODE_376x308  10
  41. #define X_MODE_376x564  11
  42.  
  43.  
  44. #define BACKWARD 0
  45. #define FORWARD  1
  46.  
  47. #define X_MODE_INVALID  -1
  48. #define ERROR            1
  49. #define OK               0
  50. extern "C" {
  51. /* FUNCTIONS =========================================================== */
  52.  
  53. extern WORD x_set_mode(
  54.         WORD mode,                /* Initialize x mode           */
  55.         WORD WidthInPixels);
  56.  
  57. extern  void x_select_default_plane( /*Enables Read/Write access to a    */
  58.                 BYTE plane);         /* a specified plane                */
  59.  
  60. extern void x_set_splitscreen(            /* set the split screen start  */
  61.         WORD line);               /*scan line (initialize)       */
  62.  
  63. extern void x_set_start_addr(
  64.         WORD X,                   /* Set the screen start        */
  65.         WORD Y);                  /* address in video ram        */
  66.  
  67. extern void x_hide_splitscreen(void); /* Disable the split screen (Split */
  68.                                       /* Screen RAM remains reserved)    */
  69.  
  70. extern void x_show_splitscreen(void); /* Enable the split screen (given it */
  71.                                       /* was previously "hidden")          */
  72.  
  73.  
  74. extern void x_adjust_splitscreen(   /* Adjust the start scan line of the */
  75.                 WORD line);         /* split screen                      */
  76.  
  77.  
  78. extern WORD x_set_doublebuffer(     /* Enable double buffering with a    */
  79.                 WORD PageHeight);   /* specified page height             */
  80.  
  81.  
  82. extern void x_page_flip(        /* Swap visible page (only when double   */
  83.                 WORD X,         /* buffering is active) & sets virt start*/
  84.         WORD Y);
  85.  
  86. extern void x_set_cliprect(    /* Define the clipping rectangle */
  87.                 WORD left,     /* NOTE: left and right are in bytes */
  88.                 WORD top,
  89.                 WORD righ,
  90.         WORD bottom);
  91.  
  92. extern void x_text_mode(void);  /* return to text mode */
  93.  
  94.  
  95. /* VARIABLES =========================================================== */
  96.  
  97. extern BYTE InGraphics;             /* non zero if in X graphics mode      */
  98. extern WORD CurrXMode;              /* contains current X graphics mode id */
  99. extern WORD ScrnPhysicalByteWidth;  /* Physical screen width in bytes      */
  100. extern WORD ScrnPhysicalPixelWidth; /* Physical screen width in pixels     */
  101. extern WORD ScrnPhysicalHeight;     /* Physical screen height in pixels    */
  102. extern WORD ErrorValue;             /* Error return value                  */
  103. extern WORD SplitScrnOffs;          /* Offset in VRAM  of split screen     */
  104. extern WORD SplitScrnScanLine;      /* Scan line split screen starts at    */
  105.                     /* initially. Resizing the split scrn  */
  106.                     /* using the other functions does not  */
  107.                     /* change this value                   */
  108. extern WORD SplitScrnVisibleHeight; /* Height of the visible portion of the*/
  109.                     /* split screen.                       */
  110. extern WORD Page0_Offs;             /* Offset in VRAM of main virt. screen */
  111. extern WORD Page1_Offs;             /* Offset in VRAM of 2nd virt. screen  */
  112. extern WORD ScrnLogicalByteWidth;   /* Virtual screen width in bytes       */
  113. extern WORD ScrnLogicalPixelWidth;  /* Virtual screen width in pixels      */
  114. extern WORD ScrnLogicalHeight;      /* Virtual screen height in pixels     */
  115. extern WORD MaxScrollX;             /* Max X position of physical screen   */
  116.                                     /*  within virtual screen              */
  117. extern WORD MaxScrollY;             /* Max Y position of physical screen   */
  118.                     /*  within virtual screen              */
  119. extern WORD DoubleBufferActive;     /* Indicates whether double buffering  */
  120.                                     /* is active                           */
  121. extern WORD VisiblePageIdx;         /* Index number of visible page 0 or 1 */
  122. extern WORD HiddenPageOffs;         /* Offset of Hidden Pg | only valid    */
  123. extern WORD VisiblePageOffs;        /* Offset of Visible Pg| for D.B. mode */
  124. extern WORD NonVisual_Offs;         /* Offset of first non-visible VRAM    */
  125.  
  126. extern WORD TopClip;                /* Clipping rectangle                  */
  127. extern WORD BottomClip;
  128. extern WORD LeftClip;
  129. extern WORD RightClip;
  130.  
  131. extern WORD PhysicalStartPixelX;    /* Coordinates of physical (visible) */
  132. extern WORD PhysicalStartByteX;     /* screen relative to the virtual    */
  133. extern WORD PhysicalStartY;         /* screen's U.L. corner              */
  134. }
  135. #endif
  136.  
  137.  
  138.